<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>test</title>
<%@ include file="/common/commonLib.jsp"%>
</head>
<body>
<center>课程相关测试<br>
<button id="addCourse">教师添加课程</button><br>
</center>
</body>

<script>

$(document).ready(function(){
	 $("#addCourse").on("click",addCourse);  
})

var json={
			"courseCode":"sdfs",
			"name":"sdf",
			"courseHour":10,
			"credit":10,
			"sumWeeks":10,
			"description":"sdfsdfsdafsdf"
	}
	
	 $.post(CONTEXT_PATH+"course/ajaxCreate", {
			data : JSON.stringify(json)
		}, function(data) {
			if(data.status=="success"){
				alert("success");
			}else{
				alert("wrong");
			}
		}); 

</script>
</html>